import request from './../utils/request'


export default {
  login(data) {
    /**
     * post 请求
     * 接收两个参数
     * 第一个参数 接口地址
     * 第二个参数 接口所需要的参数
     * 
     * http://139.224.163.17/api/admin/base/open/login
     * === 
     * http://139.224.163.17/api/admin/base/open/login
     * /aaa/api/admin/base/open/login
     */
    return request.post('/aaa/api/admin/base/open/login', data)
  },

  getUserInfo() {
    return request.get('/aaa/api/admin/base/comm/person')
  },

  /**
   * 获取所属辖区
  */
  getAreas() {
    return request.post('/aaa/api/admin/base/open/areas')
  },

  /**
   * 获取餐饮单位列表
  */
  getCompanys(data) {
    return request.post('/aaa/api/admin/storeManage/cateringCompany/page', data)
  },

  delCompanys(ids) {
    return request.post('/aaa/api/admin/storeManage/cateringCompany/delete', { ids })
  },

  addCompanys(data) {
    return request.post('/aaa/api/admin/storeManage/cateringCompany/add', data)
  },

  getCompanyInfo(id) {
    return request.get('/aaa/api/admin/storeManage/cateringCompany/info?id=' + id)
  },

  updateCompany(data) {
    return request.post('/aaa/api/admin/storeManage/cateringCompany/update', data)
  },

  /**
   * 上传图片
   * @param {} data 
   * @returns 
   */
  uploadImg (data) {
    return request.post('/bbb/api/tools/upload', data)
  }
  
}